<template>
	<view class="supply-chain-detail">
		<block v-for="(item, index) in list" :key="item.id">
			<view class="supply-chain-detail-card" @click="linkDetail(item.id)" :style="{'borderTop': index != 0 ? '1rpx solid #B3B3B3' : 'unset'}">
				<image :src="item.img" mode="aspectFill" class="supply-chain-detail-card_img" />
				<view class="supply-chain-detail-card-other-info">
					<text class="supply-chain-detail-card-name">{{item.name}}</text>
					<view class="supply-chain-detail-card-tags">
						<block v-for="v in item.tags" :key="v">
							<view class="supply-chain-detail-card-tag">{{v}}</view>
						</block>
					</view>
				</view>
			</view>
		</block>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
						id: 1,
						img: '../../static/logo.png',
						name: '深圳市乐品实业',
						tags: ['茶叶茶底', '水果制品', '剧团', '连队', '演出团'],
						stores: '562',
						area: '22万'
					},
					{
						id: 2,
						img: '../../static/logo.png',
						name: '深圳市乐品实业',
						tags: ['茶叶茶底', '水果制品'],
						stores: '562',
						area: '22万'
					},
					{
						id: 3,
						img: '../../static/logo.png',
						name: '深圳市乐品实业',
						tags: ['茶叶茶底', '水果制品'],
						stores: '562',
						area: '22万'
					},
					{
						id: 4,
						img: '../../static/logo.png',
						name: '深圳市乐品实业',
						tags: ['茶叶茶底', '水果制品'],
						stores: '562',
						area: '22万'
					},
					{
						id: 5,
						img: '../../static/logo.png',
						name: '深圳市乐品实业',
						tags: ['茶叶茶底', '水果制品'],
						stores: '562',
						area: '22万'
					},
					{
						id: 6,
						img: '../../static/logo.png',
						name: '深圳市乐品实业',
						tags: ['茶叶茶底', '水果制品'],
						stores: '562',
						area: '22万'
					},
					{
						id: 7,
						img: '../../static/logo.png',
						name: '深圳市乐品实业',
						tags: ['茶叶茶底', '水果制品'],
						stores: '562',
						area: '22万'
					},
					{
						id: 8,
						img: '../../static/logo.png',
						name: '深圳市乐品实业',
						tags: ['茶叶茶底', '水果制品'],
						stores: '562',
						area: '22万'
					},
					{
						id: 9,
						img: '../../static/logo.png',
						name: '深圳市乐品实业',
						tags: ['茶叶茶底', '水果制品'],
						stores: '562',
						area: '22万'
					},
					{
						id: 10,
						img: '../../static/logo.png',
						name: '深圳市乐品实业',
						tags: ['茶叶茶底', '水果制品'],
						stores: '562',
						area: '22万'
					},
					{
						id: 11,
						img: '../../static/logo.png',
						name: '深圳市乐品实业',
						tags: ['茶叶茶底', '水果制品'],
						stores: '562',
						area: '22万'
					},
					{
						id: 12,
						img: '../../static/logo.png',
						name: '深圳市乐品实业',
						tags: ['茶叶茶底', '水果制品'],
						stores: '562',
						area: '22万'
					},
				],
			};
		},
		methods: {
			linkDetail(id) {
				uni.navigateTo({
					url: `/pages/companyDetail/companyDetail?id=${id}`,
					animationType: 'slide-in-right', // 指定动画类型
					animationDuration: 1000 // 动画时长
				})
			}
		}
	}
</script>

<style scoped>
	.supply-chain-detail {
		padding: 20rpx;
	}

	.supply-chain-detail-card {
		padding: 32rpx;
		background: #ffffff;
		display: flex;
	}

	.supply-chain-detail-card_img {
		width: 130rpx;
		height: 130rpx;
	}

	.supply-chain-detail-card-other-info {
		display: flex;
		flex-direction: column;
		margin-left: 20rpx;
	}

	.supply-chain-detail-card-name {
		font-size: 28rpx;
		font-weight: 600;
		letter-spacing: 2rpx;
	}

	.supply-chain-detail-card-tags {
		font-size: 24rpx;
		color: #999999;
		display: flex;
		flex-wrap: wrap;
		gap: 10rpx;
		font-weight: 500;
		margin-top: 16rpx;
	}
	.supply-chain-detail-card-tag {
		padding: 6rpx 14rpx;
		background: #f5f5f5;
		border-radius: 5rpx;
	}
</style>